﻿/*
 * Created by SharpDevelop.
 * User: alejandrom
 * Date: 01/07/2011
 * Time: 18:44
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */
using System;
using System.Drawing;
using System.Windows.Forms;
using GeneradorCodigoDB4O.Objetos;
using Db4objects.Db4o.Activation;
using Db4objects.Db4o.Config;
using Db4objects.Db4o;
using Db4objects.Db4o.Query;
using Db4objects.Db4o.IO;
using Db4objects.Db4o.Messaging;
using Db4objects.Db4o.TA;
using Db4objects.Db4o.Ext;
using Db4objects.Db4o.Collections;
using Db4objects.Db4o.Constraints;
using Db4objects.Db4o.Types;
using Db4objects.Db4o.Events;
using Db4objects.Db4o.Foundation.IO;
using Db4objects.Db4o.Foundation.Collections;


namespace GeneradorCodigoDB4O
{
	/// <summary>
	/// Description of Principal.
	/// </summary>
	public partial class Principal : Form
	{
		Encuesta objEncuesta;
		
		public Principal()
		{
			//
			// The InitializeComponent() call is required for Windows Forms designer support.
			//
			InitializeComponent();
			
			//
			// TODO: Add constructor code after the InitializeComponent() call.
			//
			
		}
		public void CrearEncuesta(){
			objEncuesta = new Encuesta();
		}
		
		void BTN_GuardarClick(object sender, EventArgs e)
		{
			CrearEncuesta();
//			objEncuesta.FormulariosList.Add(new Formulario());
//			objEncuesta.FormulariosList[0].Encuesta = TXT_Encuesta.Text;
//			objEncuesta.FormulariosList[0].PreguntasList.Add(new Preguntas());
//			objEncuesta.FormulariosList[0].PreguntasList[0].Name = "a1_1";
//			objEncuesta.FormulariosList[0].PreguntasList[0].Tipo = "S";
//			
			Db4objects.Db4o.IObjectContainer db = Db4objects.Db4o.Db4oEmbedded.OpenFile("C:\\PREGUNTAS.DB4O");
			
			
			try
			{
				// do something with db4o
			}
			finally
			{
				db.Close();
			}
		}
	}
}
